/*
 * RegularExpression.h
 *
 *  Created on:  Jun 5, 2009
 *      Author:  Zach Riggle A37627537
 *      Project: CSE410 Project 1
 */

#ifndef REGULAREXPRESSION_H_
#define REGULAREXPRESSION_H_

#include <string>
#include <regex.h>

using namespace std;


/**
 * Regular Expression class.  Wraps up the regex functionality into a
 * very simple class.  Simply provide the expression to the constructor,
 * and call match() against the desired string.  Only if the ENTIRE
 * string matches the expression, does match() return true.
 */
class RegularExpression {
public:

    RegularExpression(string expressionValue);
    virtual ~RegularExpression();

    int getCompileResult();

    bool match(string s);
protected:
    void compile();

    string stringValue;
    regex_t regexValue;
    int compileValue;
};

#endif /* REGULAREXPRESSION_H_ */
